package com.hr.domain.po;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 房源表
 * @TableName house
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class House {
    /**
     * 
     */
    private Long id;

    /**
     * 房源标题
     */
    private String title;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 面积(平方米)
     */
    private BigDecimal area;

    /**
     * 租金(元/月)
     */
    private BigDecimal rent;

    /**
     * 支付方式(1:月付,2:季付)
     */
    private Integer paymentType;

    /**
     * 房东ID(关联user表)
     */
    private Long landlordId;

    /**
     * 发布时间
     */
    private LocalDateTime publishTime;

    /**
     * 状态(0:下架,1:上架)
     */
    private Integer status;

    /**
     * 朝向
     */
    private String orientation;

    /**
     * 房源描述
     */
    private String description;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        House other = (House) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getRent() == null ? other.getRent() == null : this.getRent().equals(other.getRent()))
            && (this.getPaymentType() == null ? other.getPaymentType() == null : this.getPaymentType().equals(other.getPaymentType()))
            && (this.getLandlordId() == null ? other.getLandlordId() == null : this.getLandlordId().equals(other.getLandlordId()))
            && (this.getPublishTime() == null ? other.getPublishTime() == null : this.getPublishTime().equals(other.getPublishTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getOrientation() == null ? other.getOrientation() == null : this.getOrientation().equals(other.getOrientation()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getRent() == null) ? 0 : getRent().hashCode());
        result = prime * result + ((getPaymentType() == null) ? 0 : getPaymentType().hashCode());
        result = prime * result + ((getLandlordId() == null) ? 0 : getLandlordId().hashCode());
        result = prime * result + ((getPublishTime() == null) ? 0 : getPublishTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getOrientation() == null) ? 0 : getOrientation().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", address=").append(address);
        sb.append(", area=").append(area);
        sb.append(", rent=").append(rent);
        sb.append(", paymentType=").append(paymentType);
        sb.append(", landlordId=").append(landlordId);
        sb.append(", publishTime=").append(publishTime);
        sb.append(", status=").append(status);
        sb.append(", orientation=").append(orientation);
        sb.append(", description=").append(description);
        sb.append("]");
        return sb.toString();
    }



}